package com.hxkj.service;

import com.hxkj.domain.po.AllocationFunction;
import com.hxkj.domain.po.AuthRole;
import com.platform.common.domain.result.ResultDataStruct;
import com.platform.common.domain.result.ResultMessageStruct;
import com.platform.common.domain.result.ResultPageStruct;
import com.platform.common.domain.to.PageTo;


/**
 * 权限mapper
 * <p>
 * Created by chenfangzhou on 2018/5/15.
 */
public interface AuthRoleService {

    /**
     * 保存用户信息
     *
     * @param authRole
     * @return
     * @throws Exception
     */
    ResultMessageStruct saveAuthRole(AuthRole authRole) throws Exception;

    /**
     * 根据用户ID获取用户姓名
     *
     * @param
     * @return
     * @throws Exception
     */
    ResultDataStruct<AuthRole> getAuthRole(AuthRole authRole) throws Exception;


    /**
     * 获取符合条件的所有用户
     *
     * @return
     * @throws Exception
     */
    ResultPageStruct<AuthRole> getRoleList(AuthRole authRole, PageTo pageParam) throws Exception;

    /**
     * 获取符合条件的所有用户
     *
     * @return
     * @throws Exception
     */
    ResultPageStruct<AuthRole> getAuthRoleBySlave(AuthRole authRole, PageTo pageParam) throws Exception;


    /**
     * 用户锁示例
     *
     * @param roleId
     * @throws Exception
     */
    //void AuthRoleLock(Long roleId) throws Exception;


    /**
     * 从缓存中获取数据
     * @param authRole
     * @return
     * @throws Exception
     */
   // AuthRole getAuthRoleFromCache(AuthRole authRole) throws Exception;


    /**
     * 更新用户缓存
     * @param authRole
     */
    ResultMessageStruct updateAuthRole(AuthRole authRole) throws Exception;

    /**
     * 删除用户缓存
     * @param authRole
     */
    ResultMessageStruct deleteAuthRole(AuthRole authRole) throws Exception;


    /**
     * 从缓存中获取数据
     * @param authRole
     * @return
     * @throws Exception
     */
   // AuthRole getAuthRoleRefresh(AuthRole authRole) throws Exception;

    /**
     * 获取改角色已分配的功能/全部功能
     *
     * @param authRole 角色
     * @return  已分配的功能/全部功能
     * @throws Exception
     */
    AllocationFunction getFunction(AuthRole authRole) throws Exception;
    /**
     * 获取改角色已分配的功能/全部功能
     *
     * @param authRole 角色
     * @return  已分配的功能/全部功能
     * @throws Exception
     */
    AllocationFunction getFunctions(AuthRole authRole) throws Exception;

    /**
     * 为该角色分配功能
     *
     * @param authRole 角色
     * @return  已分配的功能/全部功能
     * @throws Exception
     */
    ResultMessageStruct saveAllocationFunction(AuthRole authRole) throws Exception;
}
